/*
 * $Id: MessageController.java 46 2013-05-03 21:38:12Z gabakyan $
 * $Author: gabakyan $
 * $Revision: 46 $
 * $Date: 2013-05-03 21:38:12 +0000 (Fri, 03 May 2013) $
 *
 * Copyright (c) 2013 Supply Chain Intelligence (SCI), Inc.
 * http://www.scintelligence.com/, Email: info@scintelligence.com
 * All rights reserved.
 *
 * This file is part of Logistics Map.
 *
 * Logistics Map is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, version 3 of the License.
 *
 * Logistics Map is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Logistics Map.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.sci.logisticsmap.web.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.PostConstruct;

/**
 * The Controller for processing message view/ajax requests.
 *
 * @author gabakyan@gmail.com (Last modified by $Author: gabakyan $)
 * @version $Revision: 46 $
 */
@Controller
@RequestMapping("")
public class MessageController extends BaseController {
    /**
     * The base message path.
     */
    public static final String PATH_MESSAGE_BASE = "/message/";

    /**
     * The locked down message path.
     */
    public static final String PATH_MESSAGE_LOCKED_DOWN = "/message/locked-down";
    /**
     * The not allowed country message path.
     */
    public static final String PATH_MESSAGE_NOT_ALLOWED_COUNTRY = "/message/not-allowed-country";

    /**
     * The blocked user message path.
     */
    public static final String PATH_MESSAGE_BLOCKED_USER = "/message/blocked-user";
    /**
     * The rejected user message path.
     */
    public static final String PATH_MESSAGE_REJECTED_USER = "/message/rejected-user";
    /**
     * The unapproved user message path.
     */
    public static final String PATH_MESSAGE_UNAPPROVED_USER = "/message/unapproved-user";

    /**
     * The locked down message view.
     */
    private static final String viewLockedDownMessage = "message/lockedDownMessagePage";
    /**
     * The not allowed country message view.
     */
    private static final String viewNotAllowedCountryMessage = "message/notAllowedCountryMessagePage";

    /**
     * The blocked user message view.
     */
    private static final String viewBlockedUserMessage = "message/blockedUserMessagePage";
    /**
     * The rejected user view.
     */
    private static final String viewRejectedUserMessage = "message/rejectedUserMessagePage";
    /**
     * The unapproved user message view.
     */
    private static final String viewUnapprovedUserMessage = "message/unapprovedUserMessagePage";

    /**
     * The default constructor.
     * Initializes a Controller class.
     */
    public MessageController() {
    }

    /*
     * (non-Javadoc)
     *
     * @see BaseController#init()
     */
    @PostConstruct
    public void init() {
        super.init();
    }

    /**
     * The method to response on the locked down message view request.
     *
     * @param  model
     *         The model.
     *
     * @return the locked down message view.
     */
    @RequestMapping(value=PATH_MESSAGE_LOCKED_DOWN, method={RequestMethod.GET})
    public String onLockedDownMessage(Model model) {
        return viewLockedDownMessage;
    }

    /**
     * The method to response on the not allowed country message view request.
     *
     * @param  model
     *         The model.
     *
     * @return the not allowed country message view.
     */
    @RequestMapping(value=PATH_MESSAGE_NOT_ALLOWED_COUNTRY, method={RequestMethod.GET})
    public String onNotAllowedCountryMessage(Model model) {
        return viewNotAllowedCountryMessage;
    }

    /**
     * The method to response on the blocked user message view request.
     *
     * @param  model
     *         The model.
     *
     * @return the blocked user message view.
     */
    @RequestMapping(value=PATH_MESSAGE_BLOCKED_USER, method={RequestMethod.GET})
    public String onBlockedUserMessage(Model model) {
        return viewBlockedUserMessage;
    }

    /**
     * The method to response on the rejected user message view request.
     *
     * @param  model
     *         The model.
     *
     * @return the rejected user message view.
     */
    @RequestMapping(value=PATH_MESSAGE_REJECTED_USER, method={RequestMethod.GET})
    public String onRejectedUserMessage(Model model) {
        return viewRejectedUserMessage;
    }

    /**
     * The method to response on the unapproved user message view request.
     *
     * @param  model
     *         The model.
     *
     * @return the unapproved user message view.
     */
    @RequestMapping(value=PATH_MESSAGE_UNAPPROVED_USER, method={RequestMethod.GET})
    public String onUnapprovedUserMessage(Model model) {
        return viewUnapprovedUserMessage;
    }
}
